package com.bosssoft.setp.model.business.aliance;

import com.bosssoft.setp.handler.AlianceBusinessGradeProxy;
import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.upms.model.base.HyperModel;


import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Set;

/**
 * 加盟商等级的类定义
 *
 * @author lin-gaoying
 * @version 1.1
 * @since 1.0
 */
@Erupt(name = "加盟商等级", dataProxy = AlianceBusinessGradeProxy.class)
@Table(name = "setp_aliance_business_grade")
@Entity
@Getter
@Setter
public class AlianceBusinessGrade extends HyperModel {

    @EruptField(
            views = @View(title = "加盟商等级名称",sortable = true),
            edit = @Edit(title = "加盟商等级名称", notNull = true, search = @Search(vague = true))
    )
    private String alianceBusinessGradeName;

    @EruptField(
            views = @View(title = "签约费",width = "150px",sortable = true),
            edit = @Edit(title = "签约费", notNull = true)
    )
    private BigDecimal signingFee;

    @EruptField(
            views = @View(title = "租赁费",width = "150px",sortable = true),
            edit = @Edit(title = "租赁费", notNull = true)
    )
    private BigDecimal rentalFee;

    @EruptField(
            views = @View(title = "业务类型",sortable = true),
            edit = @Edit(title = "业务类型", notNull = true)
    )
    private String businessType;


    @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true)
    @OrderBy
    @EruptField(
            edit = @Edit(title = "该会员等级所拥有的设备数量", type = EditType.TAB_TABLE_ADD)
    )
    private Set<AlianceBusinessGradeParam> alianceBusinessGradeParams;


}
